import java.util.Scanner;

public class demo01 {
    //统计回文
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        StringBuilder str1=new StringBuilder(sc.nextLine());
        StringBuilder str2=new StringBuilder(sc.nextLine());
        int count=0;
        int len=str1.length()+1;
        for (int i = 0; i < len; i++) {
            StringBuilder str=new StringBuilder(str1);
            String s1=str.insert(i,str2).toString();

            StringBuilder tmp=new StringBuilder(s1);
            String s2=tmp.reverse().toString();

            if(s1.equals(s2)){
                count++;
            }
        }
        System.out.println(count);
    }
}
